import Vue from 'vue'
import Router from 'vue-router'

import Report from '@/pages/user/report/report'
import ReportInfo from '@/pages/user/report/info'
import AppointTime from '@/pages/user/report/appointtime'
import UserList from '@/pages/user/report/userlist'

import Opinion from '@/pages/user/opinion/opinion'

import Orders from '@/pages/user/orders/orders'
import OrderDetail from '@/pages/user/orders/orderdetail'
import ReportDetail from '@/pages/user/orders/reportdetail'

import Me from '@/pages/me/me'
import OperSucc from '@/pages/oper/opersucc'
import OperFail from '@/pages/oper/operfail'

// 工人端
import MemberIndex from '@/pages/member/index/index'
import MemberOrderDetail from '@/pages/member/orderdetail/orderdetail'
import MemberMroReportDetail from '@/pages/member/mroreport/mroReportDetail'
import MemberMroReport from '@/pages/member/mroreport/mroreport'
import MemberMroList from '@/pages/member/mroreport/mrolist'
import MemberOrders from '@/pages/member/orders/orders'
import PatrolList from '@/pages/member/patrol/patrolList'
import PatrolDetail from '@/pages/member/patrol/patrolDetail'
import PatrolInfo from '@/pages/member/patrol/patrolInfo'

// 管理端
import Decision from '@/pages/member/decision/decision'
import Arrange from '@/pages/member/arrange/arrange'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Report',
      component: Report,
      meta: {
        title: '报修-选择',
        keepAlive: false
      }
    },
    {
      path: '/reportinfo/:ty/:tyname?',
      name: 'ReportInfo',
      component: ReportInfo,
      meta: {
        title: '报修-填写',
        keepAlive: true
      }
    },
    {
      path: '/opinion',
      name: 'Opinion',
      component: Opinion,
      meta: {
        title: '记录-评价',
        keepAlive: true
      }
    },
    {
      path: '/appoittime',
      name: 'AppointTime',
      component: AppointTime,
      meta: {
        title: '预约时间',
        keepAlive: false
      }
    },
    {
      path: '/userlist',
      name: 'UserList',
      component: UserList,
      meta: {
        title: '指定负责人',
        keepAlive: false
      }
    },
    {
      path: '/orders',
      name: 'Orders',
      component: Orders,
      meta: {
        title: '历史记录',
        keepAlive: true
      }
    },
    {
      path: '/orderdetail/:oid?',
      name: 'OrderDetail',
      component: OrderDetail,
      meta: {
        title: '服务单详情',
        keepAlive: false
      }
    },
    {
      path: '/reportdetail',
      name: 'ReportDetail',
      component: ReportDetail,
      meta: {
        title: '报修详情',
        keepAlive: false
      }
    },
    {
      path: '/me',
      name: 'Me',
      component: Me,
      meta: {
        title: '我',
        keepAlive: false
      }
    },
    {
      path: '/opersucc',
      name: 'OperSucc',
      component: OperSucc,
      meta: {
        title: '操作成功',
        keepAlive: false
      }
    },
    {
      path: '/operfail',
      name: 'OperFail',
      component: OperFail,
      meta: {
        title: '操作失败',
        keepAlive: false
      }
    },
    // 工人端
    {
      path: '/mindex',
      name: 'MemberIndex',
      component: MemberIndex,
      meta: {
        title: '服务单列表',
        keepAlive: false
      }
    },
    {
      path: '/morderdetail/:oid?',
      name: 'MemberOrderDetail',
      component: MemberOrderDetail,
      meta: {
        title: '服务单详情',
        keepAlive: false
      }
    },
    {
      path: '/mreport',
      name: 'MemberMroReport',
      component: MemberMroReport,
      meta: {
        title: '填写检修报告',
        keepAlive: true
      }
    },
    {
      path: '/mrolist',
      name: 'MemberMroList',
      component: MemberMroList,
      meta: {
        title: '维修项列表',
        keepAlive: false
      }
    },
    {
      path: '/mreportdetail',
      name: 'MemberMroReportDetail',
      component: MemberMroReportDetail,
      meta: {
        title: '维修报告详情',
        keepAlive: false
      }
    },
    {
      path: '/morders',
      name: 'MemberOrders',
      component: MemberOrders,
      meta: {
        title: '历史记录',
        keepAlive: true
      }
    },
    // 管理端
    {
      path: '/decision',
      name: 'Decision',
      component: Decision,
      meta: {
        title: '决策操作',
        keepAlive: true
      }
    },
    {
      path: '/arrange',
      name: 'Arrange',
      component: Arrange,
      meta: {
        title: '排班',
        keepAlive: false
      }
    },
    {
      path: '/patrollist',
      name: 'PatrolList',
      component: PatrolList,
      meta: {
        title: '巡检记录',
        keepAlive: true
      }
    },
    {
      path: '/patroldetail',
      name: 'PatrolDetail',
      component: PatrolDetail,
      meta: {
        title: '巡检详情',
        keepAlive: false
      }
    },
    {
      path: '/patrolinfo',
      name: 'PatrolInfo',
      component: PatrolInfo,
      meta: {
        title: '巡检报告',
        keepAlive: false
      }
    }
  ]
})
